SREP-3365: Add service log aggregation to validate-pull-secret-ext#835
Conversation
|
Skipping CI for Draft Pull Request. |
Aggregates multiple pull secret validation failures into a single service log instead of prompting for each failure individually. This improves the user experience and reduces service log noise. Changes: - Aggregate failures and send one service log at end of validation - Add --skip-service-logs flag for testing/automation - Use new pull_secret_multiple_sync_failures.json template - Add helper functions: buildTemplateParameters, formatFailureDisplay, recordServiceLogFailure, sendAggregatedServiceLogs - Update validation functions to record failures instead of sending immediately - Remove obsolete sendPullSecretServiceLog and sendPullSecretMismatchServiceLog - Add comprehensive unit tests for new functions Related: SREP-3365, SREP-3321 Depends on: openshift/managed-notifications#400 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Chris Collins <collins.christopher@gmail.com>
Replace direct accessor methods with Get*() methods for optional fields in the OCM SDK to properly distinguish between unset and empty values. Changes: - RegistryCredential: Use GetToken() and GetUsername() instead of Token() and Username() - Registry: Use GetName() instead of Name() - AccessTokenAuth: Use GetEmail() and GetAuth() instead of Email() and Auth() This improves error handling by correctly identifying when optional fields are not set versus when they contain empty strings, and adds missing validation for the email field in secTokenAuth. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
e39fd0e to
95d91ff
Compare
WalkthroughThis PR refactors pull-secret validation to aggregate failures into a single post-run service log instead of sending logs immediately on each error. New exported constants and a ChangesPull-Secret Validation Aggregation
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
- Add nolint:gosec for G101 false positive on URL constant - Fix staticcheck QF1012: use fmt.Fprintf in formatFailureDisplay - Regenerate docs for new --skip-service-logs flag - Add tests for sendAggregatedServiceLogs early-return paths - Add test for recordServiceLogFailure nil map initialization Created with assistance from Claude 🤖 <claude@anthropic.com> Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
|
@clcollins: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
@clcollins: This pull request references SREP-3365 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/label tide/merge-method-squash |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clcollins, joshbranham The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Improves
validate-pull-secret-extby aggregating multiple validation failures into a single service log instead of prompting foreach failure individually.
Changes
--skip-service-logsfor testing/automationpull_secret_multiple_sync_failures.jsonwithFAILURE_LISTparameterExample Output
Pull Secret Validation Failures: Pull Secret Issues
Found 3 failure(s):
[Service log prompt with all failures listed]
Dependencies
Testing
Related Issues
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Improvements
Tests
Documentation